package com.authine.cloudpivot.ext.dto.kingDee.request;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;


@Data
@JsonInclude(value= JsonInclude.Include.NON_NULL)
@Schema(description = "金蝶实例")
public class KingDeeEntity {

    @JsonProperty("Creator")
    @Schema(description = "创建人")
    private String creator;

    @JsonProperty("NumberSearch")
    @Schema(description = "NumberSearch")
    private String numberSearch;

    @JsonProperty("ValidateFlag")
    @Schema(description = "ValidateFlag")
    private String validateFlag;

    @JsonProperty("IsDeleteEntry")
    @Schema(description = "IsDeleteEntry")
    private String isDeleteEntry;

    @JsonProperty("IsEntryBatchFill")
    @Schema(description = "IsEntryBatchFill")
    private String isEntryBatchFill;

    @JsonProperty("NeedUpDateFields")
    @Schema(description = "NeedUpDateFields")
    private List<?> needUpDateFields;

    @JsonProperty("NeedReturnFields")
    @Schema(description = "NeedReturnFields")
    private List<?> needReturnFields;

    @JsonProperty("SubSystemId")
    @Schema(description = "SubSystemId")
    private String subSystemId;

    @JsonProperty("InterationFlags")
    @Schema(description = "InterationFlags")
    private String interationFlags;

    @JsonProperty("IsVerifyBaseDataField")
    @Schema(description = "IsVerifyBaseDataField")
    private String isVerifyBaseDataField;

    /**
     * 新增字段1
     */
    @JsonProperty("IsAutoSubmitAndAudit")
    @Schema(description = "IsAutoSubmitAndAudit")
    private String isAutoSubmitAndAudit;

    @JsonProperty("Model")
    @Schema(description = "Models")
    private List<ModelEntity> model;


    public static KingDeeEntity newKing() {
        KingDeeEntity k = new KingDeeEntity();

        k.setNumberSearch("true");
        k.setValidateFlag("true");
        k.setIsDeleteEntry("true");
        k.setIsEntryBatchFill("true");
        k.setNeedUpDateFields(new ArrayList<>());
        k.setNeedReturnFields(new ArrayList<>());
        k.setSubSystemId("");
        k.setInterationFlags("");
        k.setIsAutoSubmitAndAudit("false");
        return k;
    }

    public static KingDeeEntity saveKing() {
        KingDeeEntity k = new KingDeeEntity();
        k.setCreator("");
        k.setNeedUpDateFields(new ArrayList<>());
        k.setNeedReturnFields(new ArrayList<>());
        k.setIsDeleteEntry("true");
        k.setIsVerifyBaseDataField("false");
        k.setIsEntryBatchFill("true");
        k.setValidateFlag("true");
        k.setNumberSearch("true");
        k.setInterationFlags("");
        k.setIsAutoSubmitAndAudit("true");
        return k;
    }

}
